package com.nulldev.util.net.packets.p2pc;

import com.nulldev.util.net.packets.APILevel;
import com.nulldev.util.net.packets.NetInfo;
import com.nulldev.util.net.packets.PacketManager;
import com.nulldev.util.net.packets.UniversalPacket;

@APILevel(level = 1)
@Deprecated
/**
 * Replaced by nCrypt API in nullUtil 2.6
 * @since nullUtil 2.0 / nPacket 1.0
 * @author null
 *
 */
public class P2PCDefineIP extends UniversalPacket{

	public P2PCDefineIP() {
		super("p2pC: Define IP", "p2pc.defip", "null");
	}

	@Override
	public void client(byte[] data, byte[] raw, final NetInfo client) {
		client.setDefIP(createString(data));
	}

	@Override
	public void server(byte[] data, byte[] raw, final NetInfo connection) {
		connection.sendBlocking(PacketManager.fromID("p2pc.defip", connection.format()));
	}

}
